var newCar = {
    
    init: function(){
        newCar.insert();
        mask.setCarMask();
    },

    insert: function(){
        var form = document.getElementById('newCarForm');
                
        if(form){
            form.carOkButton.onclick = function(){
                if(validation.newCarData(form)){
                    form.submit(); 
                }   
            } 
        } 
    }
    
};

newCar.init();

